<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/', function () {
    dump('guizhou');
    return view('welcome');
});

Route::any('demo', 'Demo@index');

Route::post('pull', function (\Illuminate\Http\Request $request) {
    if ($request->get('password') == '123456789') {
        exec('cd /data/hero_chicken_web_guizhou && git pull 2>&1', $out, $code);
        echo "状态：{$code}";
        return json_encode($out);
    }
    echo "验证错误";
});

Route::post('browseCount',function (){
    \Illuminate\Support\Facades\Redis::ZINCRBY('BROWSE_COUNT',1, date('Y-m-d'));
});


Route::post('downloadCount',function (){
    \Illuminate\Support\Facades\Redis::ZINCRBY('DOWNLOAD_COUNT',1, date('Y-m-d'));
});

//无需登陆验证的路由
Route::group([], function () {
    Route::any('Login', 'Login@logic');
    Route::any('Register', 'Register@logic');
    Route::any('WxLogin', 'WxLogin@logic');
    Route::any('MiguLogin', 'MiGuLogin@logic');
    Route::get('MiguChargeCallback', 'MiGuPayCallback@callback');
    //微信支付回调
    Route::post('WeiChatPay/notify_url', 'WeChatApplyPayCallBack@handle');
    //微信支付免密签约回调
    Route::post('EntrustWebCallback', 'WeChatWithholdCallBack@handle');
    //微信支付免密解约回调
    Route::post('DeleteContractCallback', 'WeChatWithholdCallBack@deleteContract');
    //发送注册时短信验证码
    Route::get('SmsRegister', 'Sms@register');
    //存储微信头像到本地
    Route::get('saveWeChatAvaterUrl','UploadWeChatAvaterUrl@handle');
    Route::any('FuncSwitch', 'FuncSwitch@logic');
});


//需要验证登录的路由
Route::group(['middleware' => ['check.login']], function () {
    Route::any('BuyGold', 'BuyGold@logic');
    Route::any('CheckPlayerIfGame', 'CheckPlayerIfGame@logic');
    Route::any('MailList', 'MailList@logic');
    Route::any('ReadMail', 'ReadMail@logic');
    Route::any('ReadAccessoryMail', 'ReadMail@readAccessoryMail');
    Route::any('deleteMail', 'ReadMail@delete');
    Route::any('MonthlyCalendar', 'MonthlyCalendar@logic');
    Route::any('PaiWeiInfo', 'PaiWeiInfo@logic');
    Route::any('PaiWeiReward', 'PaiWeiReward@logic');
    Route::any('RefreshMoney', 'RefreshMoney@logic');
    Route::any('RewardBox', 'RewardBox@logic');
    Route::any('SignIn', 'SignIn@logic');
    Route::any('UseItem', 'UseItem@logic');
    Route::any('TaskList', 'TaskList@logic');
    Route::any('RechargeTaskList', 'RechargeTaskList@logic');
    //俱乐部
    Route::any('CreateRoom', 'RoomRec@create');
    Route::any('DissolutionRoom', 'RoomRec@dissolution');
    Route::any('CreateClub', 'Club@create');
    Route::any('UpdateClubName', 'Club@updateClubName');
    Route::any('JoinInClub', 'Club@joinIn');
    Route::any('ClubList', 'Club@table');
    Route::any('ClubMembers', 'Club@member');
    Route::any('ClubRequest', 'Club@requestList');
    Route::any('HandleRequest', 'Club@handleRequest');
    Route::any('ExitClub', 'Club@exitClub');
    Route::any('CheckClub', 'Club@checkClub');
    Route::any('DissolveClub', 'Club@dissolve');
    Route::any('ClubRoomList', 'Club@room');
    Route::any('AddClubRoom', 'RedisRoom@clubRoom');
    Route::any('AddRoom', 'RedisRoom@Room');
    //每日登录抽奖
    Route::any('GetLuckyDraw', 'LuckyDraw@get');
    Route::any('HandleLuckyDraw', 'LuckyDraw@handle');
    //生成咪咕订单号
    Route::any('MiguOrder', 'MiGuPay@generateOrder');
    //钻石兑换房卡
    Route::any('BuyTicket', 'BuyTicket@handle');
    //快抢赛
    Route::get('QuicklyGrab', 'QuicklyGrab@index');
    Route::get('QuicklyGrabTicket', 'QuicklyGrab@ticket');
    Route::get('ExchangeTicket', 'QuicklyGrab@exchangeTicket');
    Route::get('QuicklyGrabRecord', 'QuicklyGrab@prize');
    Route::get('QuicklyRec', 'QuicklyGrab@rec');
    //生成微信订单号
    Route::get('WeChatApplyPay', 'WeChatApplyPay@logic');
    //苹果支付二次验证
    Route::post('ApplePay', 'ApplePay@logic');
    //会员权益
    Route::get('VipGoods', 'Vip@index');
    Route::get('VipCreateOrder', 'Vip@createOrder');
    //代理人机制
    Route::any('ModifySpreader', 'Spread@modify');               //注册或修改代理人信息
    Route::any('SpreaderInfo', 'Spread@spreadinfo');             //获取代理人信息
    Route::any('ApplyWithdraw', 'Spread@kickback');              //申请套现
    Route::any('KickbackRecord', 'Spread@kickbackRec');          //查看返点记录
    Route::any('WithdrawRecord', 'Spread@withdrawRec');          //查看套现记录
    Route::any('SpreadTeamInfo', 'Spread@teaminfo');             //查看代理人团队信息
    Route::any('FillIdentityInfo', 'Spread@fillIdentityInfo');   //完善用户身份信息

    Route::any('Announcement', 'Announcement@logic');
    Route::any('DiamondsMall', 'DiamondsMall@logic');
    Route::any('ExchangeActionList', 'ExchangeActionList@logic');
    Route::any('ExchangeItem', 'ExchangeItem@logic');
    Route::any('FinishTask', 'FinishTask@logic');
    Route::any('GetItemList', 'GetItemList@logic');
    Route::any('GoldMall', 'GoldMall@logic');
    Route::any('TicketMall', 'GoldMall@ticketMall');
    Route::any('QueryNotice', 'QueryNotice@logic');
    Route::any('Rank', 'Rank@logic');
    Route::any('ReviewCard', 'ReviewCard@logic');
    Route::any('ServerList', 'ServerList@logic');
    Route::any('ServerDetail', 'ServerList@detail');
    Route::any('UseCard', 'UseCard@logic');
    Route::any('ViewBag', 'ViewBag@logic');

    //更换头像
    Route::get('updateIcon','PlayerInfo@update');

    //增加添加反馈
    Route::get('createFeedback','Feedback@create');

    //用户绑定UID
    Route::get('userBingDing','UserBingDing@handle');
});
